
package org.openhds.domain.model;

import java.io.Serializable;
import java.util.Calendar;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Past;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.openhds.domain.annotations.Description;
import org.openhds.domain.constraint.CheckCalendar;
import org.openhds.domain.constraint.CheckEntityNotVoided;
import org.openhds.domain.constraint.CheckIndividualNotUnknown;
import org.openhds.domain.constraint.ExtensionIntegerConstraint;
import org.openhds.domain.constraint.Searchable;


/**
 * Generated by JCodeModel
 * 
 */
@Description(description = "A Vaccination is filled out for ever Pregnancy Outcome. It contains a list of dates in which a child has received various immunications.")
@Entity
@Table(name = "vaccination")
@XmlRootElement(name = "vaccination")
public class Vaccination
    extends AuditableCollectedEntity
    implements Serializable
{

    public final static long serialVersionUID = 9088448901429863510L;
    @Searchable
    @CheckEntityNotVoided
    @CheckIndividualNotUnknown
    @ManyToOne
    @Description(description = "Individual receiving the vaccination, identified by the external id.")
    private Individual child;
    @Past
    @CheckCalendar(message = "BCG date is invalid")
    @Temporal(TemporalType.DATE)
    @Description(description = "Bcg Date.")
    private Calendar bcg;
    @Past
    @CheckCalendar(message = "Polio 1 date is invalid")
    @Temporal(TemporalType.DATE)
    @Description(description = "1st polio.")
    private Calendar polio1;
    @Past
    @CheckCalendar(message = "Polio 2 date is invalid")
    @Temporal(TemporalType.DATE)
    @Description(description = "2nd polio.")
    private Calendar polio2;
    @Past
    @CheckCalendar(message = "Polio 3 date is invalid")
    @Temporal(TemporalType.DATE)
    @Description(description = "3rd polio.")
    private Calendar polio3;
    @Past
    @CheckCalendar(message = "Polio 4 date is invalid")
    @Temporal(TemporalType.DATE)
    @Description(description = "4th polio.")
    private Calendar polio4;
    @Past
    @CheckCalendar(message = "DPT 1 date is invalid")
    @Temporal(TemporalType.DATE)
    @Description(description = "1st dpt.")
    private Calendar dpt1;
    @Past
    @CheckCalendar(message = "DPT 2 date is invalid")
    @Temporal(TemporalType.DATE)
    @Description(description = "2nd dpt.")
    private Calendar dpt2;
    @Past
    @CheckCalendar(message = "DPT 3 date is invalid")
    @Temporal(TemporalType.DATE)
    @Description(description = "3rd dpt.")
    private Calendar dpt3;
    @Past
    @CheckCalendar(message = "Measels date is invalid")
    @Temporal(TemporalType.DATE)
    @Description(description = "First child measels.")
    private Calendar measels;
    @Description(description = "Did the child receive a drop in the mouth?")
    @ExtensionIntegerConstraint(constraint = "yesNoConstraint", message = "Invalid Value for dropInMouth", allowNull = true)
    private Integer dropInMouth;
    @Description(description = "Did the child receive an injection on the thigh?")
    @ExtensionIntegerConstraint(constraint = "yesNoConstraint", message = "Invalid Value for injection", allowNull = true)
    private Integer injection;
    @Description(description = "Did the child get a BCG scar?")
    @ExtensionIntegerConstraint(constraint = "yesNoConstraint", message = "Invalid Value for bcgScar", allowNull = true)
    private Integer bcgScar;

    public Individual getChild() {
        return child;
    }

    public void setChild(Individual indiv) {
        child = indiv;
    }

    @XmlJavaTypeAdapter(org.openhds.domain.util.CalendarAdapter.class)
    public Calendar getBcg() {
        return bcg;
    }

    public void setBcg(Calendar date) {
        bcg = date;
    }

    @XmlJavaTypeAdapter(org.openhds.domain.util.CalendarAdapter.class)
    public Calendar getPolio1() {
        return polio1;
    }

    public void setPolio1(Calendar date) {
        polio1 = date;
    }

    @XmlJavaTypeAdapter(org.openhds.domain.util.CalendarAdapter.class)
    public Calendar getPolio2() {
        return polio2;
    }

    public void setPolio2(Calendar date) {
        polio2 = date;
    }

    @XmlJavaTypeAdapter(org.openhds.domain.util.CalendarAdapter.class)
    public Calendar getPolio3() {
        return polio3;
    }

    public void setPolio3(Calendar date) {
        polio3 = date;
    }

    @XmlJavaTypeAdapter(org.openhds.domain.util.CalendarAdapter.class)
    public Calendar getPolio4() {
        return polio4;
    }

    public void setPolio4(Calendar date) {
        polio4 = date;
    }

    @XmlJavaTypeAdapter(org.openhds.domain.util.CalendarAdapter.class)
    public Calendar getDpt1() {
        return dpt1;
    }

    public void setDpt1(Calendar date) {
        dpt1 = date;
    }

    @XmlJavaTypeAdapter(org.openhds.domain.util.CalendarAdapter.class)
    public Calendar getDpt2() {
        return dpt2;
    }

    public void setDpt2(Calendar date) {
        dpt2 = date;
    }

    @XmlJavaTypeAdapter(org.openhds.domain.util.CalendarAdapter.class)
    public Calendar getDpt3() {
        return dpt3;
    }

    public void setDpt3(Calendar date) {
        dpt3 = date;
    }

    @XmlJavaTypeAdapter(org.openhds.domain.util.CalendarAdapter.class)
    public Calendar getMeasels() {
        return measels;
    }

    public void setMeasels(Calendar date) {
        measels = date;
    }

    @Override
    public String toString() {
        return "Vaccination";
    }

    public Integer getDropInMouth() {
        return dropInMouth;
    }

    public void setDropInMouth(Integer data) {
        dropInMouth = data;
    }

    public Integer getInjection() {
        return injection;
    }

    public void setInjection(Integer data) {
        injection = data;
    }

    public Integer getBcgScar() {
        return bcgScar;
    }

    public void setBcgScar(Integer data) {
        bcgScar = data;
    }

}
